package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTextField;

import controller.Controller;

import viewcomponents.*;

@SuppressWarnings("serial")
public class SLogoView extends JFrame
{
	private Controller myController;
	private DemoCanvas myCanvas;
	private JTextField userInput;
	
	public SLogoView(Controller controller) throws IOException
	{
		super("SLogo");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		myController = controller;

		//Set the menu bar and add the label to the content pane.
//        setJMenuBar(new SLogoMenu().getMenuBar());
        myCanvas = new DemoCanvas();
        userInput = new JTextField();
        userInput.addActionListener(myController);
        
        getContentPane().add(myCanvas, BorderLayout.CENTER);
        getContentPane().add(userInput, BorderLayout.SOUTH);

		pack();
		setVisible(true);
	}
	
	public Observer getObserver(){
		return myCanvas;
	}
}